// 引入需要的数据
const ele = require('./data.json')
const path = require('path')
// es6 的解析写法
const { seller, goods, ratings } = ele

module.exports = {
    lintOnSave: false,

    devServer: {
        before: function (app, server, compiler) {
            app.get('/api/seller', function (req, res) {
                res.json(seller);
            });
            app.get('/api/goods', function (req, res) {
                res.json(goods);
            });
            app.get('/api/ratings', function (req, res) {
                res.json(ratings);
            });
        }
    },

    pluginOptions: {
      'style-resources-loader': {
        preProcessor: 'scss',
        'patterns': [
            path.resolve(__dirname, './src/scss/*.scss'),
        ]
      }
    }
}
